# -*- coding: utf-8 -*-
import scrapy


class GuideSpider(scrapy.Spider):
    name = 'guide'
    allowed_domains = ['news.sina.com.cn']
    start_urls = ['http://news.sina.com.cn/guide/']

    def parse(self, response):
        title01s = response.css("div.section")
        for title01 in title01s:
            print(title01.css("h2.tit01::text").extract_first())
            title02s = title01.css("div.clearfix")
            for title02 in title02s:
                print('  '+title02.css("h3.tit02 a::text,h3.tit02 span::text,h3.tit02::text").extract_first(),end=': ')
                #print(title02.css("li a::text").extract())
                title03s = title02.css("li")
                for title03 in title03s:
                    print(title03.css("li a::text").extract_first(),end=' ')
                print('')
